<template>
  <div>
    <Chart :cdata="cdata" />
  </div>
</template>

<script>
import Chart from './chart.vue';
export default {
  data () {
    return {
      cdata: {
        xData: [],
        seriesData: []
      }
    }
  },
  components: {
    Chart,
  },
  mounted () {
  },
  methods: {
  },
  props: {
    info: {
      type: Object
    }
  },
  watch: {
    info: {
      handler (newVal) {
        if (newVal) {
          this.cdata = {
            xData: ["35岁以下(含)", "36-49岁(含)","50-53岁(含)", "54-59岁(含)","60岁以上(含)"],
            seriesData: [
              { value: newVal.age_0, name: "35岁以下(含)" },
              { value: newVal.age_1, name: "36-49岁(含)" },
              { value: newVal.age_2, name: "50-53岁(含)" },
              { value: newVal.age_3, name: "54-59岁(含)" },
              { value: newVal.age_4, name: "60岁以上(含)" },
            ]
          }
        }
      },
      immediate: true,
      deep: true
    }
  }
}
</script>

<style lang="scss" scoped>
</style>